package com.example.web;

import com.example.domain.Account;
import com.example.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by crowndint on 2018/10/2.
 */

@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @RequestMapping("findAll")
    public List<Account> findAll() {

        return accountService.findAll();
    }

    @RequestMapping("findAccountById/{id}")
    public Account findAccountById(@PathVariable Integer id) {

        return accountService.findAccountById(id);
    }



}
